php substring if length greater than string them .....

101

$out = strlen($in) > 50 ? substr($in,0,50)."..." : $in;
if(strlen(trim($string)) > 0){
   // $string has at least one non-space character
}

Comments

Submit
0 Comments